<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let str = `hello hi hs ^ $ world hillo \\ hi .`;
      console.log(str);

      console.log(str.match(/h\w/g));
      console.log(str.match(/\bh\w\b/g));
      // .已经被正则表达式语法征用了，需要加斜杠转义回本来的含义
      console.log(str.match(/\./g));
      console.log(str.match(/\\/g));
      console.log(str.match(/\^/g));
      console.log(str.match(/\$/g));
    </script>
  </body>
</html>
